<?php
namespace app\controller;
use app\model\User;
use think\facade\Db;

class DataTest {
    public function index() {
        // $user = Db::table('tp_user')->select();
        $user = Db::connect('mysql')->table('tp_user')->select();
        return json($user);
    }

    public function demo()
    {
        $user = Db::connect('demo')->table('tp_user')->select();
        return json($user);
    }

    public function getUser()
    {
        $user = User::select();
        return json($user);
    }
}